﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace ProjectMyFarmAndShe
{
    [Serializable]
    public class DialogData
    {
        [TextArea]
        public string Content;
        public List<OperationData> OperationDatas = new List<OperationData>();
    }

    [Serializable]
    public class OperationData
    {
        public string EventKey;
        public string Content;
    }

    public class DialogController : MonoBehaviour
    {
        public List<DialogData> DialogDatas = new List<DialogData>();
        
        private void OnCollisionEnter2D(Collision2D other)
        {
        	if (other.collider.CompareTag("Player"))
        	{
                if (UIGameController.Default.DialogPanel.gameObject.activeSelf)
                {
                    return;
                }
                
                UIGameController.Default.OpenDialogPanel().SetDialogData(DialogDatas);
        	}
        }
    }
}